﻿package com.alpheus.util
{
	
	import com.greensock.TweenMax;
	
	import flash.display.Sprite;
	
	/**
	 * 效果类
	 */
	public class EffectUtil
	{
		
		public function EffectUtil() 
		{
			
		}
		/**
		 * 鼠标RollOver发光效果
		 * @param t
		 * @param color
		 * 
		 */		
		public static function applyBtnOver(t:Sprite,color:uint=0x9d1b5b):void {
			//TweenMax.to(t, 1, { tint:color, ease:Cubic.easeOut } )
			TweenMax.to(t, .5, {glowFilter:{color:0xffffff, alpha:1, blurX:10, blurY:10}});
			//TweenMax.to(t, .3, {dropShadowFilter:{color:0xff0000, alpha:1, blurX:5, blurY:5, strength:5, angle:0, distance:0}});
		}
		/**
		 * 鼠标RollOut，移除发光效果
		 * @param t
		 * 
		 */		
		public static function applyBtnOut(t:Sprite):void {
			TweenMax.to(t, .5, {glowFilter:{remove:true,color:0xffffff, alpha:0, blurX:10, blurY:10}});
			//TweenMax.to(t,.3, {dropShadowFilter:{remove:true,color:0xff0000, alpha:0, blurX:5, blurY:5, strength:5, angle:0, distance:0}});
		}
		/**
		 * 鼠标RollOver发光效果
		 * @param t
		 * 
		 */		
		public static function applyGrow(t:*):void{
			TweenMax.to(t, .5, {glowFilter:{color:0xffffff, alpha:1, blurX:10, blurY:10,strength:2}});
		}
		/**
		 * 鼠标RollOut，移除发光效果
		 * @param t
		 * 
		 */		
		public static function removeGrow(t:*):void{
			TweenMax.to(t, .5, {glowFilter:{remove:true,color:0xffffff, alpha:0, blurX:10, blurY:10,strength:2}});
		}
		
	}

}